﻿<%@ page contentType="text/html;charset=utf-8" language="java"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:html>
<head>
		<META http-equiv=Content-Type content="text/html; charset=utf-8">
		<LINK href="../styles/sciencee.css"  type=text/css rel=stylesheet>
		<style type="text/css"></style>
		<title>CGProject</title>
		<html:base/>
</head>
<body>
<%String Flag = (String)request.getAttribute("Flag");%>
<table border="0" width="100%" cellspacing="1" id="table1" style="border: 1px solid #C0C0C0" height="152">
	<html:form action="/queryEmp" onsubmit="return  submitQueryEmp()">
	<tr>
		<td><html:select property="empNames" size="6" multiple="true" >
			<html:options collection="Result"
	                      property="employeeId"
	                      labelProperty="empName" />
	    </html:select></td>
	</tr>
	<tr>
		<td height="23" width="30%">&nbsp;<input type="button" value="选中" style="font-family: Tahoma; font-size: 11px" onclick="goBack('<%=Flag%>')"></td>
	</tr>
	</html:form>
</table>
</body>
</html:html>
<script language="javascript">
function isEmpty(theField)
{
	if(theField.value=="")
		return true;
	else
	return false;
}

function goBack(flag)
{
	var value;
	value=flag;
	if(flag=='1')
	{
		if(window.document.queryEmpForm.empNames.value=="")
		{
			
			return;
		}
		else
		{
			opener.document.changeSecLeaderForm.leaderId.value=window.document.queryEmpForm.empNames.value;
			self.close();
		}
	}
	else
	{
		if(window.document.queryEmpForm.empNames.value=="")
		{
			
			return;
		}
		else
		{
			opener.document.addSecForm.leaderId.value=window.document.queryEmpForm.empNames.value;
			self.close();
		}
	}
}
function submitQueryEmp()
{
	var emptyField=0;
	if(queryEmpForm.check1.checked==true)
	{
	 	if(isEmpty(window.document.queryEmpForm.name)==true)
 		{
     		
     		window.document.queryEmpForm.name.focus();
     		return false;
 		}
	}
 	window.document.queryEmpForm.submit();
 }

</script>